package com.ncs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ncs.pojo.Table;
import com.ncs.service.TableService;
import com.ncs.mapper.TableMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author Lenovo
* @description 针对表【table】的数据库操作Service实现
* @createDate 2022-09-05 14:33:14
*/
@Service
public class TableServiceImpl extends ServiceImpl<TableMapper, Table>
    implements TableService{

    @Override
    public void updateState(int id) {
        Table table = new Table();
        String state = table.getState();
        if (state == "used"){
            table.setState("free");
        }else if (state == "free"){
            table.setState("used");
        }
        this.updateById(table);
    }
}




